<template>
    <div>
        <TopBar title="更改维修人员（开发测试用）" iconshow></TopBar>
        <van-form @submit="onSubmit">
            <van-field
                v-model="id"
                name="工单id"
                label="工单id"
                placeholder="工单id"
                :rules="[{ required: true, message: '请填写工单id' }]"
            />
            <van-field
                v-model="hid"
                name="维修人员id"
                label="维修人员id"
                placeholder="维修人员id"
                :rules="[{ required: true, message: '请填写维修人员id（暂无为-1）' }]"
            />
            <div style="margin: 16px;">
                <van-button round block type="info" native-type="submit" style="display: inline">提交</van-button>
            </div>
        </van-form>
    </div>
</template>

<script>
import TopBar from "@/components/TopBar";

export default {
    // eslint-disable-next-line vue/multi-word-component-names
    name: "updateForm",
    data() {
        return {
            id: '',
            hid: null,
        };
    },

    components: {
        TopBar,
    },

    methods: {
        onSubmit() {
            this.$axios({
                method: 'put',
                url: 'http://47.97.219.99:8018/cloudForm/transferFormById',
                params: {
                    id: this.id,
                    hid: this.hid
                },
                headers: {'content-type': 'x-www-form-urlencoded'},
            })
            this.$router.push('/etc')
            this.$notify({
                title: '成功',
                message: '更改成功',
                type: 'success'
            })
        }
    }
}
</script>

<style scoped>

</style>
